package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.sql.Time;
import java.util.Date;

/**
 * Created by LN on 2017/7/11.16:02
 */
@Entity
@Table(name = "draw_activity")
@DynamicInsert
public class DrawActivityEntity extends BaseEntity {
    private String code;
    private String name;
    private Date startDate;
    private Time activeStartTime;
    private String description;
    private Date obviouslyStartDate;
    private Date endDate;
    private Date obviouslyEndDate;
    private Time activeEndTime;
    private String remark;
    private String needDrawCode;
    private String needCoupon;
    private String needMember;
    private String needBindPms;

    @Basic
    @Column(name = "code")
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "description")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Basic
    @Column(name = "start_date")
    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    @Basic
    @Column(name = "end_date")
    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    @Basic
    @Column(name = "active_start_time")
    public Time getActiveStartTime() {
        return activeStartTime;
    }

    public void setActiveStartTime(Time activeStartTime) {
        this.activeStartTime = activeStartTime;
    }

    @Basic
    @Column(name = "active_end_time")
    public Time getActiveEndTime() {
        return activeEndTime;
    }

    public void setActiveEndTime(Time activeEndTime) {
        this.activeEndTime = activeEndTime;
    }

    @Basic
    @Column(name = "obviously_start_date")
    public Date getObviouslyStartDate() {
        return obviouslyStartDate;
    }

    public void setObviouslyStartDate(Date obviouslyStartDate) {
        this.obviouslyStartDate = obviouslyStartDate;
    }

    @Basic
    @Column(name = "obviously_end_date")
    public Date getObviouslyEndDate() {
        return obviouslyEndDate;
    }

    public void setObviouslyEndDate(Date obviouslyEndDate) {
        this.obviouslyEndDate = obviouslyEndDate;
    }

    @Basic
    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Basic
    @Column(name = "need_draw_code")
    public String getNeedDrawCode() {
        return needDrawCode;

    }
    @Basic
    @Column(name = "need_coupon")
    public String getNeedCoupon() {
        return needCoupon;
    }

    public void setNeedCoupon(String needCoupon) {
        this.needCoupon = needCoupon;
    }

    public void setNeedDrawCode(String needDrawCode) {
        this.needDrawCode = needDrawCode;
    }
    @Basic
    @Column(name = "need_bind_pms")
    public String getNeedBindPms() {
        return needBindPms;
    }

    public void setNeedBindPms(String needPMSMember) {
        this.needBindPms = needPMSMember;
    }

    @Basic
    @Column(name = "need_member")
    public String getNeedMember() {
        return needMember;
    }

    public void setNeedMember(String needMember) {
        this.needMember = needMember;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DrawActivityEntity that = (DrawActivityEntity) o;

        if (code != null ? !code.equals(that.code) : that.code != null) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (startDate != null ? !startDate.equals(that.startDate) : that.startDate != null) return false;
        if (activeStartTime != null ? !activeStartTime.equals(that.activeStartTime) : that.activeStartTime != null)
            return false;
        if (description != null ? !description.equals(that.description) : that.description != null) return false;
        if (obviouslyStartDate != null ? !obviouslyStartDate.equals(that.obviouslyStartDate) : that.obviouslyStartDate != null)
            return false;
        if (endDate != null ? !endDate.equals(that.endDate) : that.endDate != null) return false;
        if (obviouslyEndDate != null ? !obviouslyEndDate.equals(that.obviouslyEndDate) : that.obviouslyEndDate != null)
            return false;
        if (activeEndTime != null ? !activeEndTime.equals(that.activeEndTime) : that.activeEndTime != null)
            return false;
        if (remark != null ? !remark.equals(that.remark) : that.remark != null) return false;
        if (needDrawCode != null ? !needDrawCode.equals(that.needDrawCode) : that.needDrawCode != null) return false;
        if (needCoupon != null ? !needCoupon.equals(that.needCoupon) : that.needCoupon != null) return false;
        return needMember != null ? needMember.equals(that.needMember) : that.needMember == null;
    }

    @Override
    public int hashCode() {
        int result = code != null ? code.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (startDate != null ? startDate.hashCode() : 0);
        result = 31 * result + (activeStartTime != null ? activeStartTime.hashCode() : 0);
        result = 31 * result + (description != null ? description.hashCode() : 0);
        result = 31 * result + (obviouslyStartDate != null ? obviouslyStartDate.hashCode() : 0);
        result = 31 * result + (endDate != null ? endDate.hashCode() : 0);
        result = 31 * result + (obviouslyEndDate != null ? obviouslyEndDate.hashCode() : 0);
        result = 31 * result + (activeEndTime != null ? activeEndTime.hashCode() : 0);
        result = 31 * result + (remark != null ? remark.hashCode() : 0);
        result = 31 * result + (needDrawCode != null ? needDrawCode.hashCode() : 0);
        result = 31 * result + (needCoupon != null ? needCoupon.hashCode() : 0);
        result = 31 * result + (needMember != null ? needMember.hashCode() : 0);
        return result;
    }
}
